import { Navigate, useLocation } from 'react-router-dom'

const Auth = (props: any) => {
  const { children } = props
  const { pathname } = useLocation()
  const tokenRec = ''
  return <>{tokenRec || pathname === '/login' ? children : <Navigate to="/login" replace />}</>
}

export default Auth
